package com.link.base.base.consumer.service;

import com.link.base.base.consumer.dao.mybatis.mapper.PortalAccntTagGroupMapper;
import com.link.base.base.consumer.model.PortalAccntTagGroup;
import com.link.core.basic.dao.mapper.BasicMapper;
import com.link.core.basic.service.BasicServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
/**
 * 客户标签组（头）
 * @author  yipeng.zhu@hand-china.com
 * @date:   2018/11/5 16:29
 * @version 1.0
 */

@Service
public class PortalAccntTagGroupServiceImpl extends BasicServiceImpl<PortalAccntTagGroup> implements PortalAccntTagGroupService {
    @Resource
    private PortalAccntTagGroupMapper accntAccntTagGroupMapper;

    /**
     * 覆盖父类方法
     */
    @Override
    public BasicMapper<PortalAccntTagGroup> getBasicMapper() throws Exception {
        return accntAccntTagGroupMapper;

    }

    /**
     * 标签生效
     */
    @Override
    public void groupTagApproveUpdate(PortalAccntTagGroup record) throws Exception {

        record.setValidFlag("Y");
        accntAccntTagGroupMapper.groupTagApproveUpdate(record);
    }

    /**
     * 标签失效
     */
    @Override
    public void groupTagRejectUpdate(PortalAccntTagGroup record) throws Exception {

        record.setValidFlag("N");
        accntAccntTagGroupMapper.groupTagRejectUpdate(record);
    }

    @Override
    public List<String> queryFstTags(PortalAccntTagGroup record) {
        return accntAccntTagGroupMapper.queryFstTags(record);
    }
}
